home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / SAMPLES.BIN / Calculate.java < prev    next >
Encoding:
Java Source  |  1996-12-07  |  1.4 KB  |  59 lines

  1. /*
  2.     A basic extension of the java.applet.Applet class
  3.  */
  4.  
  5. import java.awt.*;
  6. import java.applet.*;
  7.  
  8. public class Calculate extends Applet {
  9.     void LoanCalcButton_Clicked(Event event) {
  10.         //{{CONNECTION
  11.         // Create and show the Frame
  12.         (new LoanCalc()).show();
  13.         //}}
  14.     }
  15.  
  16.     void SimpleCalcButton_Clicked(Event event) {
  17.         //{{CONNECTION
  18.         // Create and show the Frame
  19.         (new CalculateFrame()).show();
  20.         //}}
  21.     }
  22.  
  23.  
  24.     public void init() {
  25.         super.init();
  26.  
  27.         //{{INIT_CONTROLS
  28.         setLayout(null);
  29.         addNotify();
  30.         resize(284,153);
  31.         label1 = new java.awt.Label("Welcome to the Calculation Applet!",Label.CENTER);
  32.         label1.reshape(18,18,234,18);
  33.         add(label1);
  34.         SimpleCalcButton = new java.awt.Button("Simple Calculations");
  35.         SimpleCalcButton.reshape(66,54,144,24);
  36.         add(SimpleCalcButton);
  37.         LoanCalcButton = new java.awt.Button("Loan Calculations");
  38.         LoanCalcButton.reshape(66,90,144,24);
  39.         add(LoanCalcButton);
  40.         //}}
  41.     }
  42.  
  43.     public boolean handleEvent(Event event) {
  44.         if (event.target == SimpleCalcButton && event.id == Event.ACTION_EVENT) {
  45.             SimpleCalcButton_Clicked(event);
  46.         }
  47.         if (event.target == LoanCalcButton && event.id == Event.ACTION_EVENT) {
  48.             LoanCalcButton_Clicked(event);
  49.         }
  50.         return super.handleEvent(event);
  51.     }
  52.  
  53.     //{{DECLARE_CONTROLS
  54.     java.awt.Label label1;
  55.     java.awt.Button SimpleCalcButton;
  56.     java.awt.Button LoanCalcButton;
  57.     //}}
  58. }
  59.